home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MediaClips: Full Bloom
/
Aris MediaClips - Full Bloom.iso
/
mac
/
Full Bloom™
/
Full Bloom™
/
stack.txt
< prev
Wrap
Text File
|
1993-05-18
|
31KB
|
924 lines
-- stack: in
-- format: 10 (HyperCard 2)
-- flags: 0x1000 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=640, y2=480)
-- screen: Rect(x1=0, y1=0, x2=640, y2=480)
-- card dimensions: w=640 h=480
-- scroll: x=0 y=0
-- background count: 1
-- first background id: 2786
-- card count: 2
-- first card id: 4937
-- list block id: 3986
-- print block id: 6002
-- font table block id: 3534
-- style table block id: 3139
-- free block count: 2
-- free size: 17792 bytes
-- total size: 73728 bytes
-- stack block size: 28672 bytes
-- created by hypercard version: 0x02108000
-- compacted by hypercard version: 0x02108000
-- modified by hypercard version: 0x02108000
-- opened by hypercard version: 0x02108000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x8000000008000000
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0x8888222288882222
-- patterns[4]: 0x88AA22AA88AA22AA
-- patterns[5]: 0xCCAA33AACCAA33AA
-- patterns[6]: 0xEEAABBAAEEAABBAA
-- patterns[7]: 0xEEBBBBEEEEBBBBEE
-- patterns[8]: 0xFFBBFFEEFFBBFFEE
-- patterns[9]: 0xFFBBFFFFFFBBFFFF
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x00000E120E121F00
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x13FCCD8F
----- HyperTalk script -----
-- Media ClipsΓäó
-- RELEASE v.4.1
-- Written by Bill Dawson
-- for Aris EntertainmentΓäó
--ΓÇó Externals Used In This Stack
-- XFCN
-- FindInField*,FileVersion**,GetDir,SystemPath*,Ants**,IsFile*,
-- CDDriveList*,SCSIIDToName*,FolderPath*,FolderContents,Resources***,ChangeStr,ResFilOpen,
-- ResNamExists,wsGet***,WindowScript***,ResourceList***,ScreenInfo***,NewFileName*
-- XCMD
-- About**,CopyFile******,Textoid****,PutAlert*****,PICTToClip****,FindInXCMD*,CreateFolder,
-- ResRemove,QTMovie*,QTPict*,ResFilClose,UseResFil,ResRename,CopyRes,wsSend***,wsSet***
-- ClipToPict****
-- * © Apple Computer, Inc.
-- ** © Copyright 1988 - 90 by Jay Hodgdon, Ignatz Software
-- *** © Heizer Software, Lee Buck
-- **** © Frederic Rinaldi, 1990,1991
-- ***** © 1989 by S.Koren & COM~LINK
-- ****** © Guy de Picciotto
--ΓÇó Stack Scripts
on openStack
global pList,ifBackground,windowName,theProgress,theDialog,stackOpen,theSplash
checkCPUtype
extractPrefs
if ifBackground = TRUE then get windowScript("Blackout")
if last item of screenInfo(MAIN) = 342 then
put "Splash(LC)"into theSplash -- LC
else put "Aris Splash" into theSplash
hide card window
if stackOpen Γëá TRUE then play "aris.logo"
put TRUE into stackOpen
get WindowScript(theSplash&return&"i0_IdleDelay:30"&return&"i3_Value:0"&return&"i3_Visible:TRUE")
set cursor to watch
showPicture
end openStack
on checkCPUtype -- more robust next time, but it's deadline now!
hide the scroll window
set the cantModify of this stack to FALSE
set the rect of this card to (word 2 to 5 of screenInfo(MAIN))
set the rect of the card window to (word 2 to 5 of screenInfo(MAIN))
end checkCPUtype
on cleanUp
global windowName
killOpenWindows
if there is a window windowName then close window windowName
KillAbout
killPalette
closePalette
deleteMenu
lock screen
-- show splash screen (Aris Logo) momentarily to reset CLUT
picture "Goodbye",resource,dialog
wait 3 sec
close window "Goodbye"
if there is a window "Blackout" then close window "Blackout"
show cd window
end cleanUp
on idle
global moviePlaying,newPict
if moviePlaying Γëá TRUE then checkWindow
if newPict = TRUE then
put FALSE into newPict
showPicture
end if
checkPalette
if the sound = "done" then stopSound
end idle
on killOpenWindows
global pictureList,checkPICT,theOid,windowName,lastPictID,currPictID
set cursor to 4
if currPictID Γëá lastPictID and there is a window id lastPictID then close window id lastPictID
if there is a window theOid then close window theOid
put TRUE into checkPICT
end killOpenWindows
--ΓÇó Pictures
on openPicture which
global currPictID
put id of window which into currPictID
end openPicture
on showPicture
global windowName,pDepth,pSize,pStyle,altPath,lastSnd,ifSound,currPictID,lastPictID,ifXL, theSplash
if there is a window theSplash then close window theSplash
set cursor to 4
if altPath Γëá empty then
checkBitDepth
set cursor to watch
if pSize = "" and pDepth = "24 Bit" and item 3 of screenInfo(Main) ≥ 640 and ifXL = TRUE then
if isFile(locateF() & pDepth & " XL" & ":"&windowName) then put " XL" into pSize
end if
put getEOF(locateF() & pDepth & pSize & ":"&windowName) into bufferSize
if (bufferSize * 2) + 301 < the heapSpace then
put currPictID into lastPictID
picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,true
killOpenWindows
else if bufferSize + 301 > the heapSpace then
if there is a window id currPictID then close window id currPictID
killOpenWindows
put currPictID into lastPictID
picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,true,0
else
if there is a window id currPictID then close window id currPictID
killOpenWindows
put currPictID into lastPictID
picture locateF() & pDepth & pSize & ":"&windowName,file,pStyle,false
end if
put FALSE into newSize
checkWindow
getInfo
if ifSound then
playSound
end if
else
listDir
end if
checkWindow
end showPicture
on closePicture windowName
global windowName,pictureList
checkwindow
end closePicture
on mouseDownInPicture
global theSplash
if there is a window theSplash then
hide window theSplash
close window theSplash
showPicture
end if
wait 10
if the mouseClick then doZoom
end mouseDownInPicture
--ΓÇó Menus
on createMenu
if there is a menu "ArisΓäó" then exit createMenu
create menu "ArisΓäó"
put createMenuItems() into menu "ArisΓäó" -- with menuMsg createMenuMsgs()
if there is a menu "Edit" then
if last menuItem of menu "Edit" = "Icon..." then
set commandChar of last menuItem of menu "Edit" to ""
end if
end if
set the commandChar of menuItem 3 of menu "ArisΓäó" to "9"
set the commandChar of menuItem 5 of menu "ArisΓäó" to "I"
set the commandChar of menuItem 9 of menu "ArisΓäó" to "?"
end createMenu
function createMenuItems
return "Sound" & return & "-" & return & "Palette" & return & "-" & return & "Show Info..." & return & "Preferences" & return & "-" & return & "Switch Disks..." & return & "Help" & return
end createMenuItems
function createMenuMsgs
return "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return & "" & return
end createMenuMsgs
on deleteMenu
if there is a menu "ArisΓäó" then delete menu "ArisΓäó"
end deleteMenu
on doMenu whichMenu
global ifSound,ifInfo,useAltPath,altPath,paletteName
if whichMenu = "Sound" then
if the checkmark of menuItem "Sound" of menu "ArisΓäó" = FALSE then
set the checkmark of menuItem "Sound" of menu "ArisΓäó" to TRUE
put TRUE into ifSound
playSound
else
set the checkmark of menuItem "Sound" of menu "ArisΓäó" to FALSE
put FALSE into ifSound
end if
else if whichMenu = "Palette" then
if the checkmark of menuItem "Palette" of menu "ArisΓäó" = FALSE then
createPalette
else
killPalette
end if
else if whichMenu = "Show Info..." then
if the checkmark of menuItem "Show Info..." of menu "ArisΓäó" = FALSE then
set the checkmark of menuItem "Show Info..." of menu "ArisΓäó" to TRUE
put TRUE into ifInfo
doAbout
else
set the checkmark of menuItem "Show Info..." of menu "ArisΓäó" to FALSE
put FALSE into ifInfo
doAbout
end if
else if whichMenu = "Preferences" then
send showPrefs to card
else if whichMenu = "Help" then
putAlert "",108 -- Palette Help
if the result = 2 then
putAlert "",105 -- Menu Help
if the result = 2 then doMenu "Help"
end if
else if whichMenu = "Compact Stack" then
killPalette
if there is a window "Blackout" then close window "Blackout"
pass doMenu
else if whichMenu = "About Hypercard..." then
global windowName,theSplash
get ResFilOpen(value of word 2 of the long name of this stack)
if there is a window windowName then hide window windowName
picture "a", resource, dialog
close window "a"
get item 5 of the long version of this stack
convert it to short date
get WindowScript(theSplash&return&"i2_Text:"&"Version"&&fileVersion("short")&&"-" && it)
if there is a window windowName then
show window windowName
end if
else if whichMenu = "Find..." then goFind
else if whichMenu = "Switch Disks..." then
get FolderPath("Please locate a ΓÇ£Media ClipsΓäóΓÇ¥ Disk or Folder for me.")
if it Γëá empty then
put it into altPath
put TRUE into useAltPath
showFirst
end if
else if whichMenu = "First" then
showFirst
else if whichMenu = "Next" then
showNext
else if whichMenu = "Prev" then
showPrev
else if whichMenu = "Last" then
showLast
else if whichMenu = "Quit Hypercard" then
cleanUp
pass doMenu
else pass doMenu
end doMenu
on makeAbout
About "About Media ClipsΓäó..."
end makeAbout
on KillAbout
About "About Hypercard..."
end killAbout
--ΓÇó Palette
on createPalette
global paletteName,pLoc
set checkmark of menuItem "Palette" of menu "ArisΓäó" to TRUE
get FolderContents(locateF("Movies") & "Movies:",files,"noDialog")
if it contains "Sorry" or it is empty or hasQT() = FALSE then put "wsPaletteSM" into paletteName
else put "wsPalette" into paletteName
if pLoc = empty then
if paletteName contains "Sm" then
put (item 3 of the screenrect - 406)/2 & "," & item 4 of the screenrect - 53 into pLoc
else put (item 3 of the screenrect - 440)/2 & "," & item 4 of the screenrect - 53 into pLoc
end if
if there is a window paletteName then
show window paletteName
exit createPalette
else
get windowScript(paletteName & return & "i0_TopLeft:" & pLoc)
end if
end createPalette
on createPaletteZ
global pLoc,paletteName
put "z" into char 1 of paletteName
if pLoc = empty then
put (item 3 of the screenrect - 440)/2 & "," & item 4 of the screenrect - 53 into pLoc
end if
if there is a window paletteName then
show window paletteName
exit createPaletteZ
else
palette paletteName,pLoc
end if
end createPaletteZ
on switchPalette which
if which = on then
killPalette
createPaletteZ
else if which = off then
killPalette
createPalette
end if
end switchPalette
on checkPalette
global paletteName
if there is a window paletteName then
send "bringtofront" to window paletteName
show window paletteName
end if
end checkPalette
on checkWindow
global windowName
if there is a window blackout then wsSend Blackout,0,"sendtoback"
if there is a window windowName then show window windowName
end checkWindow
on killPalette
global paletteName
if there is a window paletteName then close window paletteName
set checkmark of menuItem "Palette" of menu "ArisΓäó" to FALSE
end killPalette
on openPalette
set the checkmark of menuItem "Palette" of menu "ArisΓäó" to TRUE
end openPalette
on closePalette
global pLoc,paletteName
if there is a window paletteName then
put the loc of window paletteName into pLoc
end if
if there is a menu "ArisΓäó" then
set the checkmark of menuItem "Palette" of menu "ArisΓäó" to FALSE
end if
end closePalette
function ifPalette
global paletteName
if there is a window paletteName then
return TRUE
else return FALSE
end ifPalette
--ΓÇó Palette Handlers
on showFirst
global pList,windowName,theOid
if pList = empty then listDir
put line 1 of pList into windowName
showPicture
end showFirst
on showPrev
global pList,windowName,theOid
if pList = empty then listDir
get findInField(pList,windowName,"",0)
if item 3 of it Γëá 1 then put item 1 of it into start
else put 0 into start
get item 2 of findInField(pList,windowName,"",start)
if it = 1 then put line (number of lines of pList) of pList into windowName
else put line it - 1 of pList into windowName
showPicture
end showPrev
on showNext
global pList,windowName,pList,theOid
if pList = empty then listDir
get findInField(pList,windowName,"",0)
if item 3 of it Γëá 1 then put item 1 of it into start
else put 0 into start
get item 2 of findInField(pList,windowName,"",start)
if it Γëá (number of lines of pList) then
put line item 2 of findInField(pList,windowName,"",start) + 1 of pList into windowName
else put line 1 of pList into windowName
showPicture
end showNext
on showLast
global pList,windowName,theOid
if pList = empty then listDir
put last line of pList into windowName
showPicture
end showLast
on Save2disk
global windowName,fileName,newName,pDepth,pSize,moviePlaying
if moviePlaying Γëá TRUE then
putAlert "",107
if the result = 2 then exit Save2Disk
else if the result = 3 then put "pict" into theRes
else if the result = 4 then put "pict" into theRes
else if the result = 5 then put "snd" into theRes
else if the result = 6 then put "snd" into theRes
if theRes = empty then
exit Save2Disk
else if theRes = "pict" then
put locateF() & pDepth & pSize & ":" & windowName into fileName
else if theRes = "snd" then
put locateF() & "Snd Files:" & windowName into fileName
end if
ask file "Save" && theRes && "file as:" with windowName & "." & theRes
if it Γëá empty then
put it into newName
copyFile fileName, newName, o
if the result = "0" then
if theRes = "snd" then put changeFileType(newName,"sfile","movr") into smChange
answer "ΓÇ£" & theRes & "ΓÇ¥" && "file copied successfully!" with "Cool!"
else answer "Unable to complete operation." with "Sorry"
end if
else answer "Exporting movies is not yet implimented." & return & return & "Quit and copy movie from the ΓÇ£MoviesΓÇ¥ folder." with "Rats!"
end save2disk
on goFind
global findMe,numHit,searchHits,ifFind,hitPath
if there is not a window "Find" then
get windowScript("Find" & return & "i0_Height:72" & return & "i2_Text:" & findMe & return & "i7_Text:" & numHit & return & "i9_Wordwrap:TRUE" & return & "i12_Visible:FALSE")
set "i8_Text" of window "Find" to searchHits
set "i9_Text" of window "Find" to hitPath
end if
end goFind
-- *No longer a Palette handler, but used on mouseDownInPicture*
on doZoom
global windowName,theOid,pDepth,pSize,pStyle,smallStyle,ThumbStyle,FullStyle
if there is a window windowName then close window windowName
if pSize contains "small" then
getFull
else if pSize contains "Thumbnails" then
getSmall
else
getThumb
end if
end doZoom
on doExport
global windowName,pDepth,pSize,newRect,fileName,newName,moviePlaying,nowPlaying
put the visible of cd window into restoreWindow
show cd window
checkPalette
if there is a window "Blackout" then send "Sendtoback" to window "Blackout"
show window windowName
put locateF() & pDepth & pSize & ":" & windowName into fileName
put the rect of cd window into cdRect
put the rect of window windowName into subRect
put ants() into theRect -- the rect returned from the userΓÇÖs selection
put item 1 of cdRect + item 1 of theRect - item 1 of subRect into item 1 of newRect
put item 2 of cdRect + item 2 of theRect - item 2 of subRect into item 2 of newRect
put item 3 of theRect - item 1 of theRect + item 1 of newRect into item 3 of newRect
put item 4 of theRect - item 2 of theRect + item 2 of newRect into item 4 of newRect
set cursor to watch
if moviePlaying Γëá TRUE then
ask file "Name for new PICT file" with windowName & ".pict"
else ask file "Save movie clip as:" with nowPlaying & ".movie clip"
if it Γëá empty then
set cursor to watch
put it into newName
PICTToClip fileName,"False",newRect
put ClipToPict(newName,MDRW) into result
if the result contains "Error" then
answer "Not enough memory to complete operation." & return & "Try ΓÇ£Save to DiskΓÇ¥ or ΓÇ£QuitΓÇ¥ & try again." with "Sorry"
else
put changeFileType(newName,"PICT","8BIM") into smChange
end if
end if
set the visible of cd window to restoreWindow
end doExport
on playSound x
global windowName,lastSnd,myRefNum,ifSlideShow,paletteName,sndfileName,stopShow
if ifSlideShow = empty then put false into ifSlideShow
if windowName Γëá lastSnd then
put locateF() & "Snd Files:" & windowName into sndfileName
end if
put windowName into lastSnd
if ifSlideShow then
if the sound is "done" then
set cursor to 4
playItAgainSoundm sndFileName,windowName
put windowName into the sound
else
play stop
put "done" into the sound
createPalette
end if
exit playSound
end if
if the sound Γëá "done" then
play stop
put "done" into the sound
if paletteName contains "Sm" then
set i6_Name of window paletteName to nosound
else set i7_Name of window paletteName to nosound
else
if paletteName contains "Sm" then
set i6_Name of window paletteName to sound
else set i7_Name of window paletteName to sound
set cursor to 4
playItAgainSound sndFileName,windowName
put windowName into the sound
end if
end playSound
on stopSound
global paletteName
if there is a window paletteName then
if paletteName contains "Sm" then
if i6_Name of window paletteName Γëá nosound then
set i6_Name of window paletteName to nosound
end if
else
if i7_Name of window paletteName Γëá nosound then
set i7_Name of window paletteName to nosound
end if
end if
end if
end stopSound
on sndPicker
checkColor
if there is not a window "Sound Picker" then
get windowScript("Sound Picker")
send BuildSndList to card
set i1_GrowItem of window "Sound Picker" to true
end if
end sndPicker
on getPICT
-- Picture "Picker" window
global pDepth,pSize,windowName,myRefNumber,ICNfileName,pList
if there is not a window "Picture Picker" then
if there is a window windowName then hide window windowName
put locateF() & "Data:" & discName() & ".Resources" into ICNfileName
if isFile(ICNfilename) Γëá TRUE then
put thisPath() & discName() & ".Resources" into ICNfileName
end if
if isFile(ICNfilename) and the optionKey = UP then
if pDepth Γëá "24 bit" then picture "a", resource, dialog
get windowScript("Picture Picker")
put ResourceList(ICNfileName,"ICN#","ID") into x
put resFilOpen(ICNfileName) into myRefNumber
set i1_Text of window "Picture Picker" to x
set i1_GrowItem of window "Picture Picker" to true
if there is a window "a" then
close window "a"
end if
else if isFile(ICNfilename) and the optionKey = DOWN then
get windowScript("Picture Picker")
set i1_Style of window "Picture Picker" to "Standard"
set i1_Text of window "Picture Picker" to pList
set i1_GrowItem of window "Picture Picker" to true
else if the optionKey = UP then
get windowScript("Picture Picker")
set i1_Style of window "Picture Picker" to "Standard"
set i1_Text of window "Picture Picker" to pList
set i1_GrowItem of window "Picture Picker" to true
else
send BuildListOfICNs to background
end if
end if
end getPICT
function thispath
get the value of word 2 of the long name of this stack
delete char (length of it - length of short name of this stack)+1 to (Length of it) of it
put it into checkPath
return checkPath
end thispath
function discName
get LocateF()
delete last char of it
return it
end discName
on slideShow
global pList,windowName,pList,ifSound,theOid,paletteName,ifSlideShow,stopShow
put true into ifSlideShow
put false into stopShow
hide window paletteName
hide menubar
repeat
if the mouseClick or stopShow then exit repeat
if there is a window theOid then close window theOid
showNext
put the ticks into Start_Ticks
repeat
if the mouseClick or stopShow then
put true into stopShow
put false into ifSlideShow
play stop
createPalette
show window paletteName
show menubar
exit slideShow
end if
if ifSound then
if the sound is "done" or stopShow then
exit repeat
end if
else if the ticks - Start_Ticks > 300 then exit repeat
end repeat
end repeat
show menubar
put true into stopShow
put false into ifSlideShow
end slideShow
on doAbout
global windowName,moviePlaying
if moviePlaying Γëá TRUE then
get "File:" && windowName
lookUp it
getTextoid
end if
end doAbout
on getThumb
global windowName,theOid,pDepth,pSize,pStyle,ThumbStyle,wID
if there is a window windowName then put ID of window windowName into wID
put " Thumbnails" into pSize
put ThumbStyle into pStyle
showPicture
end getThumb
on getSmall
global windowName,theOid,pDepth,pSize,pStyle,SmallStyle,wID
if there is a window windowName then put ID of window windowName into wID
put " (small)" into pSize
put SmallStyle into pStyle
showPicture
end getSmall
on getFull
global windowName,theOid,pDepth,pSize,pStyle,FullStyle,wID
if there is a window windowName then put ID of window windowName into wID
put empty into pSize
put FullStyle into pStyle
showPicture
end getFull
on QTshow
send getPreviews to background
end QTshow
on playQT
global QTFlick,moviePlaying,nowPlaying
put FolderContents(locateF("Movies") & "Movies:",files,"noDialog") into QTlist
if QTlist contains "Sorry" then
answer "Sorry, no QuickTimeΓäó movies were found." & return & return & "(Try selecting ΓÇ£Switch Disks...ΓÇ¥ from the ΓÇ£ArisΓäóΓÇ¥ menu.)"
else
killOpenMovies
put TRUE into moviePlaying
-- if there is a window "Movie Picker" then put "273,146" into MooVloc
put main into MooVloc
if word 3 of i27_Name of window "Movie Picker" = FALSE then
QTMovie openMovie,TallWindoid,locateF("Movies") & "Movies:" & nowPlaying,MooVloc
else
hide window "Movie Picker"
QTMovie openMovie,TallWindoid,locateF("Movies") & "Movies:" & nowPlaying,MooVloc
end if
set WindowCloseMsg of window nowPlaying to movieClosed
end if
end playQT
on movieClosed
if there is a window "Movie Picker" then show window "Movie Picker"
end movieClosed
on QTMovie
global nowPlaying,movieList
put nowPlaying & return after movieList
pass QTMovie
end QTMovie
on killOpenMovies
global movieList
repeat with i = 1 to the number of lines of movieList
if there is a window line i of movieList then close window line i of movieList
end repeat
put empty into movieList
end killOpenMovies
on QTclose
global moviePlaying
put FALSE into moviePlaying
end QTclose
--ΓÇó Textoid
on openTextoid which
global theOid,windowName,oidRect
put which into theOid
if oidRect = empty then set the globalRect of window theOid to "196,32,446,113"
else set the globalRect of window theOid to oidRect
end openTextoid
on closeTextoid which
global theOid,oidRect
put the globalRect of window theOid into oidRect
put empty into theOid
end closeTextoid
on getTextoid
global windowName,theData
get (line 1 of theData)
delete char 1 to 6 of it
if there is not a window (it && "Info") then
Textoid it && "Info",theData,"Geneva","9"
else close window (it && "Info")
testError the Result
end getTextoid
on TestError What
if What Γëá empty
then
beep
answer What
exit to HyperCard
end if
end TestError
--ΓÇó Find
on arisFind x
global theData,windowName,numHit,searchHits,findMe,searchMe
put empty into searchMe
put locateF() & "data:aris.data" into fileName
open file fileName
repeat
read from file fileName for 16384 -- max I/O buffer
put it after searchMe
if it = empty then exit repeat
end repeat
close file fileName
end arisFind
on lookUp x
global theData,windowName
put locateF() & "data:aris.data" into fileName
put empty into theData
open file fileName
repeat
read from file fileName for 16384
put it after theData
if it = empty then exit repeat
end repeat
close file filename
findInXCMD theData,x,1,FALSE
put item 4 of the result into startChar
findInXCMD theData,"Γëê",startChar,FALSE
put item 5 of the result into endChar
get char startChar to endChar of theData
delete last line of it -- kill "Γëê"
if last char of it = return then delete last char of it -- kill return
put it into thedata
end lookUp
--ΓÇó Sound
on checkSnd
global ifSound
if ifSound = TRUE then
if there is a menu "ArisΓäó" then
set checkMark of menuItem "Sound" of menu "ArisΓäó" to true
end if
else if there is a menu "ArisΓäó" then
set checkMark of menuItem "Sound" of menu "ArisΓäó" to false
end if
end checkSnd
--ΓÇó Info
on checkInfo
global ifInfo
extractPrefs
if ifInfo = TRUE then
set checkMark of menuItem "Show Info..." of menu "ArisΓäó" to true
else set checkMark of menuItem "Show Info..." of menu "ArisΓäó" to false
end checkInfo
on getInfo
global windowName
if the checkMark of menuItem "Show Info..." of menu "ArisΓäó" then doAbout
end getInfo
--ΓÇó Preferences
on ExtractPrefs
global dResult,ifBackground,ifSound,pSize,pStyle,theData,ifInfo,ifFullSize,ifSmall,ifThumb,FullStyle,SmallStyle,ThumbStyle,defaultSize,bgColor,ifXL
get openPrefs("aris.prefs")
put "Background=,Sound=,Info=,Size=,Style=,FullStyle=,SmallStyle=,ThumbStyle=,bgColor=,ifXL=" into lookWhat
repeat with i = 1 to the number of items in lookWhat
get findInField(theData,item i of lookWhat)
put item 1 of it + length of line item 2 of it of theData - 2 into stopChar
put char item 1 of it + length of item i of lookWhat to stopChar of theData into item i of intoWhat
end repeat
put item 1 of intoWhat into ifBackground
put item 2 of intoWhat into ifSound
put item 3 of intoWhat into ifInfo
put item 4 of intoWhat into pSize
put item 5 of intoWhat into pStyle
put item 6 of intoWhat into FullStyle
put item 7 of intoWhat into SmallStyle
put item 8 of intoWhat into ThumbStyle
put item 9 of intoWhat into bgColor
put item 10 of intoWhat into ifXL
put pSize into defaultSize
if pSize = empty then put TRUE into ifFullSize
else put FALSE into ifFullSize
if pSize = " (small)" then put TRUE into ifSmall
else put FALSE into ifSmall
if pSize = " Thumbnails" then put TRUE into ifThumb
else put FALSE into ifThumb
end ExtractPrefs
on writePrefs
global theData
createFolder SystemPath() & "Preferences" -- does nothing if it exists
put SystemPath() & "Preferences:aris.prefs" into fileName
open file fileName
write theData to file fileName
close file fileName
end writePrefs
--• Check Bit Depth
on CheckBitDepth
global pDepth,pSize
if last item of screenInfo(MAIN) = 342 then -- LC
if pSize = empty then
put "8 Bit LC" into pDepth
else put "8 Bit" into pDepth
exit checkBitDepth
end if
if (word 1 of screenInfo(MAIN)) > 256 then
if pSize = empty then
put "24 Bit" into pDepth
else put "8 Bit" into pDepth
else if (word 1 of screenInfo(MAIN)) = 256 then put "8 Bit" into pDepth
else if (word 1 of screenInfo(MAIN)) < 256 then putAlert "",103
end CheckBitDepth
--• Functions
function PICTsize
global pSize
if pSize = empty then put " (small)" into pSize
return pSize
end PICTsize
function locateF x
global altPath,pDepth,pSize,windowName
if altPath = empty then listDir
return altPath
end locateF
on listDir
global useAltPath,altPath,pDepth,pList
if useAltPath Γëá TRUE then
-- Check local path to see if we're in our own directory
get the value of word 2 of the long name of this stack
delete char (length of it - length of short name of this stack)+1 to (Length of it) of it
put it into checkPath
if "aris.data" is in FolderContents(checkPath & "Data", "Files","noDialog") then
put checkPath into altPath
put GetDir(checkPath & pDepth,"F","t=PICT","o=n") into pList
put ChangeStr(pList,"[44]",",","all") into pList
exit listDir
end if
-- check other SCSI drives for CD-ROMs
get line 1 of cdDriveList("noDialog")
if "Error" is not in it then
repeat with i = 1 to the number of items of it
put SCSIIDToName(item i of it) into SCSIPath
if it Γëá empty then
if "aris.data" is in FolderContents(SCSIPath & "Data:", "Files","noDialog") then
put SCSIPath into altPath
put GetDir(altPath & pDepth,"F","t=PICT","o=n") into pList
put ChangeStr(pList,"[44]",",","all") into pList
exit listDir
end if
end if
end repeat
end if
end if
repeat
-- Ask User
if "aris.data" is not in FolderContents(altPath & "Data:", "Files","noDialog") then
get FolderPath("Please locate the ΓÇ£Media ClipsΓäóΓÇ¥ Disk or Folder for me.")
if it = empty then
put empty into altPath
exit listDir
else
if it contains "Error" then
put empty into altPath
else
put it into altPath
next repeat
end if
end if
else
if "aris.data" is in FolderContents(altPath & "Data:", "Files","noDialog") then
put GetDir(altPath & pDepth,"F","t=PICT","o=n") into pList
put ChangeStr(pList,"[44]",",","all") into pList
exit listDir
end if
end if
end repeat
end listDir
Function openPrefs x
global theData
createFolder SystemPath() & "Preferences"
put SystemPath() & "Preferences:" & x into fileName
if IsFile(filename) then
open file filename
read from file filename until empty
close file filename
put it into theData
else
open file fileName
put "BackGround=TRUEΓëê" & return & "Sound=TRUEΓëê" & return & "Info=FALSEΓëê" & return & "Size= (small)Γëê" & return & "Style=plainΓëê" & return & "FullStyle=ZoomΓëê" & return & "SmallStyle=PlainΓëê" & return & "ThumbStyle=DialogΓëê" & return & "bgColor=256Γëê" & return & "ifXL=Γëê" into theData
write theData to file fileName
close file fileName
end if
return theData
end openPrefs
on checkColor
global windowName
if there is a window windowName then hide window windowName
if word 1 of screenInfo(MAIN) Γëñ 256 then
picture "a",resource, dialog -- show to reset clut
close window "a"
end if
end checkColor